import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import { BaseEntity } from 'src/entities/base.entity';
@Entity()
export class GenTable extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'bigint',
    comment: '编号',
  })
  table_id: number;

  @Column({
    type: 'varchar',
    length: 200,
    nullable:true,
    comment: '表名',
  })
  table_name: string;

  @Column({
    type: 'varchar',
    length: 500,
    nullable:true,
    comment: '表描述',
  })
  table_comment: string;

  @Column({
    type: 'varchar',
    length: 64,
    nullable:true,
    comment: '关联子表的表名',
  })
  sub_table_name: string;

  @Column({
    type: 'varchar',
    length: 64,
    nullable:true,
    comment: '子表关联的外键名',
  })
  sub_table_fk_name: string;

  @Column({
    type: 'varchar',
    length: 100,
    nullable:true,
    comment: '实体类名称',
  })
  class_name: string;

  @Column({
    type: 'varchar',
    length: 200,
    default: 'crud',
    nullable:true,
    comment: '生成模板',
  })
  tpl_category: string;

  @Column({
    type: 'varchar',
    length: 100,
    nullable:true,
    comment: '生成包路径',
  })
  package_name: string;

  @Column({
    type: 'varchar',
    length: 30,
    nullable:true,
    comment: '生成模块名',
  })
  module_name: string;

  @Column({
    type: 'varchar',
    length: 30,
    nullable:true,
    comment: '生成业务名',
  })
  business_name: string;

  @Column({
    type: 'varchar',
    length: 50,
    nullable:true,
    comment: '生成功能名',
  })
  function_name: string;

  @Column({
    type: 'varchar',
    length: 50,
    nullable:true,
    comment: '生成功能作者',
  })
  function_author: string;

  @Column({
    type: 'varchar',
    length: 1,
    default: '0',
    nullable:true,
    comment: '生成代码方式（0zip压缩包 1自定义路径）',
  })
  gen_type: string;

  @Column({
    type: 'varchar',
    length: 1,
    default: '0',
    nullable:true,
    comment: '是否继承基础字段（0不继承 1继承）',
  })
  is_extends_baseEntity: string;

  @Column({
    type: 'varchar',
    length: 200,
    nullable:true,
    comment: '父级菜单id',
  })
  parent_menu_id: string;

  @Column({
    type: 'varchar',
    length: 200,
    nullable:true,
    comment: '生成路径（不填默认项目路径）',
  })
  gen_path: string;

  @Column({
    type: 'varchar',
    length: 1000,
    nullable:true,
    comment: '其它生成选项',
  })
  options: string;
}
